home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 January: Mac OS SDK / Dev.CD Jan 98 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / PInterfaces / ShutDown.p < prev    next >
Encoding:
Text File  |  1997-08-12  |  2.5 KB  |  100 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        ShutDown.p
  3.  
  4.      Contains:    Shutdown Manager Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Release:    Universal Interfaces 3.0.1
  8.  
  9.      Copyright:    © 1987-1997 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. }
  18. {$IFC UNDEFINED UsingIncludes}
  19. {$SETC UsingIncludes := 0}
  20. {$ENDC}
  21.  
  22. {$IFC NOT UsingIncludes}
  23.  UNIT ShutDown;
  24.  INTERFACE
  25. {$ENDC}
  26.  
  27. {$IFC UNDEFINED __SHUTDOWN__}
  28. {$SETC __SHUTDOWN__ := 1}
  29.  
  30. {$I+}
  31. {$SETC ShutDownIncludes := UsingIncludes}
  32. {$SETC UsingIncludes := 1}
  33.  
  34. {$IFC UNDEFINED __TYPES__}
  35. {$I Types.p}
  36. {$ENDC}
  37. {$IFC UNDEFINED __MIXEDMODE__}
  38. {$I MixedMode.p}
  39. {$ENDC}
  40.  
  41.  
  42. {$PUSH}
  43. {$ALIGN MAC68K}
  44. {$LibExport+}
  45.  
  46.  
  47. CONST
  48.     sdOnPowerOff                = 1;                            { call procedure before power off. }
  49.     sdOnRestart                    = 2;                            { call procedure before restart. }
  50.     sdOnUnmount                    = 4;                            { call procedure before unmounting. }
  51.     sdOnDrivers                    = 8;                            { call procedure before closing drivers. }
  52.     sdOnBootVolUnmount            = 16;                            { call procedure before unmounting boot volume and VM volume but after unmounting all other volumes }
  53.     sdRestartOrPower            = 3;                            { call before either power off or restart. }
  54.  
  55.  
  56. TYPE
  57.     ShutDwnProcPtr = Register68kProcPtr;  { PROCEDURE ShutDwn(shutDownStage: INTEGER); }
  58.  
  59.     ShutDwnUPP = UniversalProcPtr;
  60.  
  61. CONST
  62.     uppShutDwnProcInfo = $00001002;
  63.  
  64. FUNCTION NewShutDwnProc(userRoutine: ShutDwnProcPtr): ShutDwnUPP;
  65.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  66.     INLINE $2E9F;
  67.     {$ENDC}
  68.  
  69. PROCEDURE CallShutDwnProc(shutDownStage: INTEGER; userRoutine: ShutDwnUPP);
  70.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  71.     {To be implemented:  Glue to move parameters into registers.}
  72.     {$ENDC}
  73. PROCEDURE ShutDwnPower;
  74.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  75.     INLINE $3F3C, $0001, $A895;
  76.     {$ENDC}
  77. PROCEDURE ShutDwnStart;
  78.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  79.     INLINE $3F3C, $0002, $A895;
  80.     {$ENDC}
  81. PROCEDURE ShutDwnInstall(shutDownProc: ShutDwnUPP; flags: INTEGER);
  82.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  83.     INLINE $3F3C, $0003, $A895;
  84.     {$ENDC}
  85. PROCEDURE ShutDwnRemove(shutDownProc: ShutDwnUPP);
  86.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  87.     INLINE $3F3C, $0004, $A895;
  88.     {$ENDC}
  89.  
  90. {$ALIGN RESET}
  91. {$POP}
  92.  
  93. {$SETC UsingIncludes := ShutDownIncludes}
  94.  
  95. {$ENDC} {__SHUTDOWN__}
  96.  
  97. {$IFC NOT UsingIncludes}
  98.  END.
  99. {$ENDC}
  100.